Skip to content

fix(auth): use prompt=login instead of select_account for OIDC sign-in - #347

Open
gabemeola wants to merge 1 commit into
QuackbackIO:mainfrom
gabemeola:fix/oidc-prompt-select-account
Open

fix(auth): use prompt=login instead of select_account for OIDC sign-in#347
gabemeola wants to merge 1 commit into
QuackbackIO:mainfrom
gabemeola:fix/oidc-prompt-select-account

Conversation

@gabemeola

Copy link
Copy Markdown

Fixes: #346

Summary

Custom OIDC sign-in fails for identity providers that don't implement the optional prompt=select_account value. buildGenericOAuthConfigs hardcodes prompt: 'select_account' for every provider, so the authorization request is rejected before authentication and the user is bounced back to /?error=invalid_request.

Reproduction

Configure a Custom OIDC provider backed by Clerk (https:///.well-known/openid-configuration).
Run Test sign-in — succeeds.
Attempt a normal sign-in via the provider button / verified-domain routing — fails and redirects to:
/?error=invalid_request&error_description=...Used+unknown+value+'[select_account]'+for+prom

Root cause

apps/web/src/lib/server/auth/build-oauth-configs.ts sends prompt: 'select_account' on every generic-OAuth config. select_account is optional per OIDC Core §3.1.2.1; providers that don't support it (Clerk, and others) return invalid_request rather than ignoring it.

This also explains why Test sign-in passes but real sign-in fails: the SSO test flow in apps/web/src/lib/server/functions/sso-test.ts already uses prompt: 'login', so the test never exercised the value production actually sends.

Fix

Send prompt: 'login' in production, matching the SSO test flow. login is broadly supported (Clerk, Okta, Auth0, Entra, Google, Keycloak) and preserves the original intent — forcing re-authentication so an admin isn't silently signed in under an existing IdP session. It also removes the test/production divergence, so a passing SSO test now exercises the same prompt production uses.

select_account is optional in OIDC and IdPs like Clerk reject it with
invalid_request, breaking sign-in while the SSO test (which uses login) passes.
@CLAassistant

CLAassistant commented Jul 29, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clerk authentication not supported

2 participants